package org.gwu.seuss.communication.util;

public class LoginValidator extends BaseValidator {

	/***
	 * Login is based upon the email format. An '@' symbol must be 
	 * specified with alpha numerics, underscores, and periods allowed on 
	 * either side.  It also must be at most 45 characters.
	 */
	
	private static final String EMAIL_PATTERN = "[A-Za-z0-9_.]*@[A-Za-z0-9_.]*";
	private static final int MAX_EMAIL_LENGTH = 45;
	
	protected String getPattern(){
		return LoginValidator.EMAIL_PATTERN;
	}

	@Override
	protected boolean extraValidation(String value) {
		//Making sure the entire length of the email is permitted.
		return (value.length() <= MAX_EMAIL_LENGTH) ? true : false;
	}
	
	
}
